#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.

FROM mcr.microsoft.com/dotnet/runtime:6.0 AS base
WORKDIR /app
EXPOSE 8088/udp
EXPOSE 8000
EXPOSE 16571
EXPOSE 16572
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build



#RUN apt-get install net-tools 
#RUN apt-get install iputils-ping -y
#RUN apt-get install mono-runtime -y
#
WORKDIR /src
COPY ["MLT.Main.EEGRepeater/MLT.Main.EEGRepeater.csproj", "MLT.Main.EEGRepeater/"]
RUN dotnet restore "MLT.Main.EEGRepeater/MLT.Main.EEGRepeater.csproj"
COPY . .
WORKDIR "/src/MLT.Main.EEGRepeater"
RUN dotnet build "MLT.Main.EEGRepeater.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "MLT.Main.EEGRepeater.csproj" -c Release -o /app/publish /p:UseAppHost=false

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "MLT.Main.EEGRepeater.dll"]

RUN apt-get update 
RUN apt-get install -y libpugixml-dev
RUN apt-get install net-tools
RUN apt-get install -y iputils-ping